package Day07_27;

public class Test_String_Idea {
    public static void main(String[] args) {
        //String 类中一些常用的ways
        //1.char   charAt( int index)
        char s1 = "我是帅哥".charAt(2);
        System.out.println(s1);
        //2. int   .compareTo()
        System.out.println("2234".compareTo("1234"));
        //3. boolean   .contains()
        System.out.println("12345".contains("23"));
        //4. boolean   .endWith()
        System.out.println("adssd.java".endsWith(".java"));
        //5.boolean    .equals()
        System.out.println("qsqwq".equals("qsqwq"));
        //6.boolean    .equalsIgnoreCase(String anotherString)
        System.out.println("asas".equalsIgnoreCase("ASAS"));
        //7. byte[]    .getBytes()
        byte[] s2 = "abcdefg".getBytes();
        for (int i = 0; i < s2.length; i++) {
            System.out.print(s2[i]);
        }
        System.out.println();
    }
}
